/*
 * @Descripttion: 
 * @version: 
 * @Author: cyj
 * @Date: 2023-01-24 23:18:22
 */
/*
 * @Descripttion: 
 * @version: 
 * @Author: cyj
 * @Date: 2023-01-07 15:44:51
 */
import request from "../../utils/request";

//获取音乐url  注:可以获取对应的音乐的 url,未登录状态或者非会员返回试听片段
export const getSongUrl = (id) => request({
    url: '/song/url',
    params: {
        id
    }
})

//检查音乐是否可用
export const checkMusic = (id) => request({
    url: '/check/music',
    params: {
        id
    }
})

//获取歌词
export const getNowLyric = (id) => request({
    url: '/lyric',
    params: {
        id
    }
})

//喜欢xx音乐  id:歌曲 id
export const likeMusic = (id, like, cookie) => request({
    url: `/like?timerstamp=${Date.now()}`,
    method: 'get',
    params: {
        id,
        like,
        cookie,
    }
})

//获取歌曲的详细信息
export const getEverySongDetail = (ids) => request({
    url: `/song/detail?timerstamp=${Date.now()}`,
    params: {
        ids,  //音乐id(支持多个id, 用 , 隔开)
    }
})

//获取用户喜欢音乐列表   需要用户登录
export const getUserSongLikeList = (uid, cookie) => request({
    url: `/likelist?timerstamp=${Date.now()}`,
    method: 'get',
    params: {
        uid,
        cookie,
    }
})